﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>HttpReports</title>

    <!-- CSS -->
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
    <link rel="stylesheet" href="/Content/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/Content/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/Content/css/form-elements.css">
    <link rel="stylesheet" href="/Content/css/style.css?ver=1.0.1"> 
 

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- Favicon and touch icons -->
    <link rel="shortcut icon" href="/Content/ico/favicon.png">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/Content/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/Content/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/Content/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="/Content/ico/apple-touch-icon-57-precomposed.png">

    <script src="~/Content/assets/js/jquery-2.1.1.min.js"></script>
    <link href="~/Content/alert/alert.css?ver=1.0.1" rel="stylesheet" />
    <script src="~/Content/alert/alert.js?ver=1.0.1"></script>

    <script src="~/Content/common/basic.js?ver=1.0.1"></script>

</head>

<body>

    <!-- Top content -->
    <div class="top-content">

        <div class="inner-bg">
            <div class="container">
                <div class="row">
                    <div class="col-sm-8 col-sm-offset-2 text">
                        <h1 style="margin-top:70px;font-weight:bolder">HttpReports</h1>
                         
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6 col-sm-offset-3 form-box">
                        <div class="form-top">
                            <div class="form-top-left">
                                <h3>登录到系统</h3> 
                            </div>
                            <div class="form-top-right">
                                <i class="fa fa-key"></i>
                            </div>
                        </div>
                        <div class="form-bottom">


                            <div class="form-group">
                                <label class="sr-only" for="form-username">Username</label>
                                <input type="text" name="form-username" placeholder="用户名" class="form-username form-control" id="form-username">
                            </div>
                            <div class="form-group">
                                <label class="sr-only" for="form-password">Password</label>
                                <input type="password" name="form-password" placeholder="密码" class="form-password form-control" id="form-password">
                            </div>
                            <button type="submit" style="width:100%" class="btn btn-submit">登 陆</button>

                        </div>
                    </div>
                </div>
                <div class="row" style="display:none">
                    <div class="col-sm-6 col-sm-offset-3 social-login">
                        <h3>...or login with:</h3>
                        <div class="social-login-buttons">
                            <a class="btn btn-link-1 btn-link-1-facebook" href="#">
                                <i class="fa fa-facebook"></i> Facebook
                            </a>
                            <a class="btn btn-link-1 btn-link-1-twitter" href="#">
                                <i class="fa fa-twitter"></i> Twitter
                            </a>
                            <a class="btn btn-link-1 btn-link-1-google-plus" href="#">
                                <i class="fa fa-google-plus"></i> Google Plus
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
     

    <!-- Javascript -->


    <script src="/Content/bootstrap/js/bootstrap.min.js"></script>
    <script src="/Content/js/jquery.backstretch.min.js"></script>
    <script src="/Content/js/scripts.js"></script>


    <script type="text/javascript">


        function Login() {

            var username = $("#form-username").val();
            var password = $("#form-password").val();

            $.ajax({
                url: "/User/CheckLogin",
                type: "POST",
                data: { username: username, password: password },
                success: function (result) {

                    if (result.code == 1) { location.href = "/Home/Index" }
                    else { Show(result.msg); }
                } 
            });  

        }

        $(document).keydown(function (e) {


            if (e.keyCode == 13) {

                Login();
            }
        });

        $(function () {

            $(".btn-submit").click(function () {
                Login();
            });

        })


    </script>

</body>

</html>